<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ include file="/safe.jsp" %>
<html>
<head>
<title>新增用户</title>
<style type="text/css">
<!--
body,td,th {
	font-family: 宋体;
	font-size: 12px;
}
-->
</style>
<script type="text/javascript">
function save(){
  if(document.getElementById('user.name').value==''){
     alert('姓名不能为空，请输入！');
     return
  }
  if(document.getElementById('user.loginName').value==''){
     alert('登录名不能为空，请输入！');
     return
  }
  if(document.getElementById('user.password').value==''){
     alert('密码不能为空，请输入！');
     return
  }
  if(document.getElementById('user.statu').value==''){
     alert('状态不能为空，请选择！');
     return
  }
  document.getElementById('from').submit();
}

</script>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#6A95B8">
<div style="background-color:#EBEBEB; width:350px; height:500px; margin-left:350px; margin-top:100px;">
<h1 style=" font-family:'华文琥珀'; color:#CC0000; text-align:center; ">用户管理</h1>
<s:form id="from" action="user_addUser.do" namespace="/info" method="post">
<table align="center" border=1 cellspacing=0 width="300px" height="400px">
<tr>
<td>
<s:textfield label="姓名" name="user.name" value="%{user.name}" required="true"/>
</td>
</tr>
<tr>
<td>
<s:textfield label="登录名" name="user.loginName" value="%{user.loginName}" required="true"/>
</td>
</tr>
<tr>
<td>
<s:password label="密码" name="user.password" value="%{user.password}" required="true"/>
</td>
</tr>
<tr>
<td>
<s:combobox label="状态" emptyOption="true" list="#{'1':'普通用户','-1':'过期用户','0':'管理员'}" name="user.statu" value="%{user.statu}" readonly="true"  required="true"/>
</td>
</tr>
<tr>
<td>
<s:textarea label="备注" name="user.note" value="%{user.note}" rows="5"/>
</td>
</tr>
<tr>
<td>
注册日期:
</td>
<td>
<s:date name="user.regDate"  format="yyyy-MM-dd"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="保存" onclick="save();"/>
<input type="button" value="返回" onclick="history.go(-1)"/>
</td>
</tr>
<s:hidden name="user.id" value="%{user.id}"/>
<s:hidden name="user.regDate" value="%{user.regDate}"/>
</table>

</s:form>
</div>
</body>
</html>
